Difference Context Functions

As described in the context calculation overview, the Difference functions are designed to provide an easy technique to calculate the difference between data points in a result set. While these can be done in semantic formulas, they are much more appropriate as context logic, because they will change to suit the selections made in a report or visual - which is significantly more efficient.

Difference Logic

The core principal behind difference calc's is to compare data points in a query and easily determine the difference between the values as you move from one item to the next. Although this concept is extended to comparing to the first and last as well, the key element is that the logic looks at the list of items (from a hierarchy) and checks the movement of data from one "row" to the next on the selected metric. By changing the hierarchy or the selections, the differential will change accordingly, without needing to redefine or recode the calculation itself (i.e. its contextual).

Examples